using RStudio.UIFramwork;
using RStudio.UnitSingleton;


/// <Summary>
///
/// </Summary>
[UIDetail("PageUIClose", "PageUIClose")]
public class PageUIClose : UIBase
{
	/// <Summary>
	/// 本地组件集
	/// </Summary>
	public DetailPageUIClose Detail;
	

	public override void InitComponent()
	{
		Detail = new DetailPageUIClose(transform);

		this.Detail.TextMeshProUGUI_Content.text = "" +
			"快去看 Hirarchy, 前面活跃的页面都被关闭了！\n\n" +
			"当我们希望有些页面可以被关闭时, UIBase.CanBeClosed 就很有必要了 \n\n" +
			"而 UIBase.ClosePrevious 则赋予关闭其他页面的权力. \n\n" +
			"如果关闭 UIBase.CanBeClosed=false 的对象，只能以 UIController.Close(UIBase) 或引用类型执行";

        this.Detail.BTN_Btn_Click.onClick.AddListener(() =>
        {
            GameService.Instance.GetService<ServiceUI>().UIEnter.Close(this);
        });

        this.Detail.TextMeshProUGUI_Tooltip.text = $"{this.GetType().Name} | 功能详细：【关旧】{this.UseClosePrevious} 【可被关】{this.CanBeClosed}";

		this.Detail.BTN_Btn_UnKnown.onClick.AddListener(() =>
		{
            GameService.Instance.GetService<ServiceUI>().UIEnter.Open<PageUnKnown>();
        });
    }
}
